package com.scs.application.modules.dept.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.FlowEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "科室需求表")
@TableName("dept_demand")
@EntityIndexAnnotation(ix={"ref_id","ref_table","dept_id"})
public class Demand extends FlowEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "申请科室ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptId;

    @EntityFieldAnnotation(
            text = "申请科室名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String deptName;

    @EntityFieldAnnotation(
            text = "业务单号",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "业务日期",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date busDate;

    @EntityFieldAnnotation(
            text = "业务主办人",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busUser;


    @EntityFieldAnnotation(
            text = "业务来源",
            length = "10",
            not_null = false,
            default_value = "DEPT_APPLY",
            comment = "安全库存:SAFE_STOCK,科室需求:DEPT_APPLY"
    )
    private String refTable;


    @EntityFieldAnnotation(
            text = "业务主办人编码",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String busUserCode;

    @EntityFieldAnnotation(
            text = "采购科室ID",
            type = EntityFieldType.LONG,
            length = "",
            default_value = "",
            comment = ""
    )
    private String deptIdTarget;

    @EntityFieldAnnotation(
            text = "采购科室名称",
            length = "50",
            default_value = "",
            comment = ""
    )
    private String deptNameTarget;

    @EntityFieldAnnotation(
            text = "订单金额(元)",
            not_null = true,
            default_value = "0.0000",
            comment = "订单金额(元)"
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "备注",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remark;

    @EntityFieldAnnotation(
            text = "关联请领Id",
            length = "20",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String refId;

    // creator ,在父类中处理


    // gmt_create ,在父类中处理


    // modifier ,在父类中处理


    // gmt_modified ,在父类中处理

    @EntityFieldAnnotation(
            text = "要求到货日期",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private String dateLates;

    @EntityFieldAnnotation(
            text = "计划类型",
            length = "20",
            comment = "normal:正常，temp：临时，clamant：紧急",
            default_value = "normal"
    )
    private String demandType;


    @EntityFieldAnnotation(
            text = "申请仓库ID",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseId;

    @EntityFieldAnnotation(
            text = "申请仓库名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String applyWarehouseName;

    @EntityFieldAnnotation(
            text = "试剂组id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = ""
    )
    private String reagentTeamId;

    // 明细数量
    @TableField(exist = false)
    private int countDtl;

}
